<#assign ctx="${springMacroRequestContext.contextPath}">
<#macro singleMenuMacro menu first>
 		<#if menu.visible>
    <li <#if first>class="topli" </#if>><a tid='${menu.id}' href="<#if  menu.channel??>${menu_path}/${menu.channel.path}<#else>${menu.link!'#'}</#if>">${menu.name}</a> 
	 	<#if  menu.open??>
		<ul> 
			<#list menu.children as sm>
				<@singleMenuMacro sm false/>
			</#list>
		</ul>
		</li>
  		</#if>		
		</#if>		
 </#macro>
 <#macro menuMacro gname >
		<#if lg_path?exists>
			<#assign menu_path = lg_path>		
		<#else>
			<#assign menu_path = ctx>		
		</#if>
<@menu gname="${gname}" ;menus><#list menus as menu>
		<@singleMenuMacro menu true/>
 	</#list>
</@menu>    

</#macro> 

<#macro singleCategoryMenuMacro category path>
<#if category.active>
   <li><a cid='${category.id!''}' href="/${path}/${category.searchKey}/">${category.name!''}</a>
				   <#if category.hasChild>
				   	<ul>
				   	<#list category.children as sub>
				   		<@singleCategoryMenuMacro sub path />
				   		</#list>
				   	</ul>
				   </#if>
 	</li>
 	</#if> 
 </#macro>

<#macro categoryGroupMenuMacro group path>
		<@categorys gname=group;result>
				<#list result as singleCategory>
 					<@singleCategoryMenuMacro singleCategory path />
 
				</#list>
 		</@categorys>
 </#macro>

















<#macro lgMenuMacro gname >
<@menu gname="${gname}" ;menus><#list menus as menu><#if menu.visible>
		<#if lg_path?exists>
			<#assign menu_path = lg_path>		
		<#else>
			<#assign menu_path = ctx>		
		</#if>
    <li class="topli"><a tid='${menu.id}' href="<#if  menu.channel??>${menu_path}/${menu.channel.path}<#else>${menu.link!'#'}</#if>"><@menuLg lg="${language}" menuId="${menu.id}" default="${menu.name}" ;result>${result}</@menuLg></a> 
	 	<#if  menu.open??>
		<ul> 
	 	<#list menu.children as  sm>
	 	<#if sm.visible>
	 	 <li>
	 	 <a href="<#if  sm.channel??>${menu_path}/${sm.channel.path}<#else>${sm.link!'#'}</#if>"><@menuLg lg="${language}" menuId="${sm.id}" default="${sm.name}" ;result>${result}</@menuLg></a>
	 	 	 	<#if  menu.open??>
				 	<#list sm.children as  ssm>
						         <ul> 			 	
							 		<#if ssm.visible>		
							 			 <li>
									 	 <a href="<#if  ssm.channel??>${menu_path}/${ssm.channel.path}<#else>${sm.link!'#'}</#if>"><@menuLg lg="${language}" menuId="${menu.id}" default="${menu.name}" ;result>${result}</@menuLg></a>
									 	 </li>
 							 		</#if>	 
 						 		</ul>	
				 	</#list>
				</#if>	 	 				
	 	 </li>
	 	 </#if>
	 	</#list>
	 	</ul>
	 	</#if>
	 	</#if>
	</#list>
</@menu>    

</#macro>